/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2024-01-25
 * Time:16:03
 */
class Money implements Cloneable{
    public double m = 10;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

public class Person implements Cloneable{
    public String name;
    public int age;

    public Money money = new Money();

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp = (Person) super.clone();
        tmp.money = (Money) this.money.clone();
        return tmp;
    }
}

class Test {
//    public static void main(String[] args) throws CloneNotSupportedException {
//        Person person = new Person("张三",20);
//        Person person2 = (Person)person.clone();//clone
//        System.out.println("person "+person.money.m);
//        System.out.println("person2 "+person2.money.m);
//        System.out.println("===========");
//        person.money.m = 100;
//        System.out.println("person "+person.money.m);
//        System.out.println("person2 "+person2.money.m);
//    }
    public static void func(Object obj) {
        System.out.println(obj);
    }

    public static void main(String[] args) {
        Student student1 = new Student("砂糖橘",98);
        Student student2 = new Student("zs",98);
        boolean ret = student1.equals(student2);
        System.out.println(ret);
    }
}